package com.txzt.gaea.provide.enums;

public enum InformationDeliveryTypeEnum {
    GZZD("规章制度", 1),
    ZZWJ("政策文件", 2),
    CYWD("常用文档", 3);

    /**
     * 编码
     */
    String code;

    /**
     * 值
     */
    int value;

    InformationDeliveryTypeEnum(String code, int value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public int getValue() {
        return value;
    }

    public static InformationDeliveryTypeEnum getByCode(String code) {
        for (InformationDeliveryTypeEnum item : InformationDeliveryTypeEnum.values()) {
            if (item.getCode().equalsIgnoreCase(code)) return item;
        }
        return null;
    }

    public static InformationDeliveryTypeEnum getByValue(int value) {
        for (InformationDeliveryTypeEnum item : InformationDeliveryTypeEnum.values()) {
            if (item.getValue() == value) return item;
        }
        return null;
    }
}
